#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export LANG=zh_CN.UTF-8
cd ~
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
    aria2c  http://222.186.59.77:30012/GoBox_v2.1.tar.xz
    tar -xf GoBox_v2.1.tar.xz
    chmod 755 /root/GoBox/GoBox
    rm -rf GoBox_v2.1.tar.xz
elif [ "$ARCH" = "aarch64" ]; then
    aria2c http://222.186.59.77:30012/Go_Box-arm.tar.xz
    tar -xf Go_Box-arm.tar.xz
    chmod 755 /root/GoBox/GoBox
    rm -rf Go_Box-arm.tar.xz
else
    echo "无法确定系统架构"
    exit
fi

echo "alias box='/root/GoBox/GoBox'" >> ~/.bashrc

#安装完成
echo -e "\033[31m安装完成,请输入:box 执行机器人安装操作\033[0m"
echo "还有其他问题欢迎加入QQ群：546537258"
echo "如果出现无法启动的情况,先自己尝试手动重启..."


#删除安装包
rm -rf /root/GoBox_*
rm -rf /root/google-chrome-*
rm -rf /root/install.sh*
rm -rf /root/node-v*
rm  -rf /root/Enviro*
rm -rf /root/Ubun*
rm -rf /root/Cento*
rm -rf /root/Debi*
rm -rf /root/main.sh*
rm -rf /root/ffmpeg-*
bash

